home *** CD-ROM | disk | FTP | other *** search
- Path: ip-pdx19-26.teleport.com!user
- From: peteski@teleport.com (Peter Miller)
- Newsgroups: comp.std.c
- Subject: Re: Is it legal to add 0 to NULL? What about NULL < NULL?
- Date: Mon, 08 Apr 1996 22:34:32 -0700
- Organization: Teleport - Portland's Public Access (503) 220-1016
- Message-ID: <peteski-0804962234320001@ip-pdx19-26.teleport.com>
- References: <ff1d.smail.smayo@tiac.net>
- NNTP-Posting-Host: ip-pdx19-26.teleport.com
-
- In article <ff1d.smail.smayo@tiac.net>, smayo@tiac.net (Scott Mayo) wrote:
-
- > I ask because a standard trick for walking an array A of size S is:
- >
- > Thing *a = A;
- > Thing *fence = a + S;
- > but in my case, if S happens to be 0, a will start out NULL. This makes we
- > worry about both the value of fence
-
- I don't think that is correct:
- If "a" is set to point to array A, then, after adding zero, it will still
- point to array A (unless A was a pointer that happended to be NULL).
-
- Peter
-